package com.net.oil.oilWear.presenter;

import com.net.oil.base.BasePresenter;
import com.net.oil.oilWear.bean.OilWearChartBean;
import com.net.oil.oilWear.bean.OilWearInfo;
import com.net.oil.oilWear.contract.OilWearContract;
import com.net.oil.oilWear.model.OilWearModel;

import java.util.List;

/**
 * 作者：lch
 * 时间：2019/1/20 0020:下午 13:37
 * 邮箱：245850413@qq.com
 * 说明：
 */
public class OilWearPresenter extends BasePresenter<OilWearContract.View> implements OilWearContract.Presenter {

    private OilWearContract.View view;
    private OilWearContract.Model model;

    public OilWearPresenter(OilWearContract.View view) {
        this.view = view;
        model = new OilWearModel(this);
    }

    @Override
    protected void unSubscribe() {
        model.unSubscribe();
    }

    @Override
    public void getOilWearInfo(int carId) {
        model.getOilWearInfo(carId);
    }

    @Override
    public void getOilWearInfoSuccess(OilWearInfo oilWearInfo) {
        view.getOilWearInfoSuccess(oilWearInfo);
    }

    @Override
    public void getOilWearInfoFailed() {
        view.getOilWearInfoFailed();
    }

    @Override
    public void getOilWearChartData(int carId, int selectId) {
        model.getOilWearChartData(carId, selectId);
    }

    @Override
    public void getOilWearChartDataSuccess(List<OilWearChartBean> oilWearChartBeans) {
        view.getOilWearChartDataSuccess(oilWearChartBeans);
    }

    @Override
    public void getOilWearChartDataFailed() {
        view.getOilWearChartDataFailed();
    }
}
